import { getGameObjectById } from "../engine";
import { Behaviour } from "../engine/Behaviour";
import { Transform } from "../engine/Transform";
import { number } from "../engine/validators/number";
import { Display } from "./Display";

export class ShopClose extends Behaviour {

    onStart() {
        this.gameObject.onClick = () => {
             console.log(this.gameObject.id);
             if(this.gameObject.id=="UI_button_close"){
                getGameObjectById('UI_Store').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_close').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_money_ChilliSauce').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_money_SunRong').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_money_Conghua').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_money_Bacon').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_money_Chicken').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_money_BJUTBox').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_Text_money_ChillSource').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_Text_money_SuanRong').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_Text_money_Conghua').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_Text_money_Bacon').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_Text_money_Chicken').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_Text_money_BJUTBox').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_moneyPurchased_ChilliSource').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_moneyPurchased_SuanRong').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_moneyPurchased_CongHua').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_moneyPurchased_Bacon').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_moneyPurchased_Chicken').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_button_moneyPurchased_BJUTBox').getBehaviour(Display).IsActive=false;
             }
        };
    }

    onTick(duringTime: number) {

    }
}
